﻿using System;
using System.Collections.Generic;

namespace QPEngine
{
	[Flags]
	public enum AppType
	{
		None = 0,
		Manager = 1,
		Realm = 1 << 1,
		Gate = 1 << 2,
		Http = 1 << 3,
		DB = 1 << 4,
		Location = 1 << 5,
		Map = 1 << 6,
		Robot = 1 << 7,
		Benchmark = 1 << 8,
		Client = 1 << 9,
        Hall = 1<<10,
        Game1 = 1 << 11,
        Game2 = 1 << 12,
        Game3 = 1 << 13,
        Game4 = 1 << 14,
        Game5 = 1 << 15,
        Game6 = 1 << 16,
        Game7 = 1 << 17,
        Game8 = 1 << 18,
        Game9 = 1 << 19,
        Game10 = 1 << 20,
        Game11 = 1 << 21,
        Game12 = 1 << 22,
        Game13 = 1 << 23,
        Game14 = 1 << 24,
        Game15 = 1 << 25,
        Game16 = 1 << 26,
        Game17 = 1 << 27,
        Game18 = 1 << 28,
        Game19 = 1 << 29,
        Game20 = 1 << 30,

        // 7
        AllServer = Manager | Realm | Gate | Http | DB | Location | Map| Hall | Game1 | Game2 | Game3 | Game4 | Game5 | Game6 | Game7 | Game8 | Game9 | Game10 | Game11 | Game12 | Game13 | Game14 | Game15 | Game16 | Game17 | Game18 | Game19 | Game20
    }

	public static class AppTypeHelper
	{
		public static List<AppType> GetServerTypes()
		{
			List<AppType> appTypes = new List<AppType> { AppType.Manager, AppType.Realm, AppType.Gate };
			return appTypes;
		}

		public static bool Is(this AppType a, AppType b)
		{
			if ((a & b) != 0)
			{
				return true;
			}
			return false;
		}
	}
}